import { ProCard, ProColumns, ProTable } from "@ant-design/pro-components";

const App:React.FC=()=>{
     interface DataType{
        code?:string,name?:string,type?:string,status?:string,degree?:string,solution?:string,
     };

     const columns:ProColumns<DataType>[]=[
        {dataIndex:'code',title:'故障编码'},{dataIndex:'name',title:'故障名称'},
        {dataIndex:'type',title:'类型'},{dataIndex:'degree',title:'故障等级'},
        {dataIndex:'solution',title:'应对方案指引'},
        {dataIndex:'status',title:'状态'},
     ];

     const tdata:DataType[]=[
        {code:'A001',name:'传动齿轮磨损',type:'生产设备',status:'正常',degree:'机械故障A级',solution:'xxx故障应对指引V1.2'},
        {code:'A002',name:'传动轴抖动',type:'生产设备',status:'正常',degree:'机械故障B级',solution:'xxx故障应对指引V1.2'},
        {code:'A003',name:'设备开机异响',type:'生产设备',status:'正常',degree:'机械故障C级',solution:'xxx故障应对指引V1.2'},
        {code:'B001',name:'无法开机',type:'生产设备',status:'正常',degree:'电气故障A级',solution:'xxx故障应对指引V1.2'},
        {code:'B002',name:'电流波动',type:'生产设备',status:'正常',degree:'电气故障B级',solution:'xxx故障应对指引V1.2'},
        {code:'C001',name:'运行温度过高',type:'生产设备',status:'正常',degree:'工艺故障A级',solution:'xxx故障应对指引V1.2'},
        {code:'C002',name:'刀具断裂',type:'生产设备',status:'正常',degree:'工艺故障A级',solution:'xxx故障应对指引V1.2'},
     ];

    return <>
         <ProCard title='故障代码' style={{height:700}}
         >
             <ProTable<DataType>
                search={false}
                options={false}
                columns={columns}
                dataSource={tdata}

                />
         </ProCard>
    </>;
};

export default App;